package com.dp.mallchat.common.common.config;

import com.dp.mallchat.common.user.dao.SensitiveWordDao;
import com.dp.mallchat.common.user.sensitive.DFAFilter;
import com.dp.mallchat.common.user.sensitive.SensitiveWordsBs;
import com.dp.mallchat.common.user.service.impl.SensitiveWordServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class SensitiveWordConfig {

    @Autowired
    private SensitiveWordServiceImpl sensitiveWordService;

    /**
     * 初始化引导类
     *
     * @return 初始化引导类
     * @since 1.0.0
     */
    @Bean
    public SensitiveWordsBs sensitiveWordBs() {
        return SensitiveWordsBs.newInstance()
                .filterStrategy(DFAFilter.getInstance())
                .sensitiveWordsBs(sensitiveWordService)
                .init();
    }

}